package yuyue

import nafos.server.structure.FullRingList
import java.util.concurrent.atomic.LongAdder


fun main() {

    val fra = FullRingList<String>(100, FullRingList.FullRingListFullEvent<String> {
                println(it.toString())
    })
    val longa = LongAdder()

    val start = System.currentTimeMillis()
    repeat(4){
        Thread {
            while (true) {
                fra.add(""+ longa.sum()/100+"156")
                longa.increment()
                Thread.sleep(1)
            }
        }.start()
    }

    while (true) {
        if (longa.sum() == 100000L) {
            println("==+"+(System.currentTimeMillis()-start))
        }
    }

}


